/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package org.apli.haiam.ejb.entidades;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author Informática
 */
@Entity
@Table(name = "hos_motivo_referencia")
@NamedQueries({
    @NamedQuery(name = "HosMotivoReferencia.findAll", query = "SELECT h FROM HosMotivoReferencia h")})
public class HosMotivoReferencia implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "hmr_id")
    private Integer hmrId;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 128)
    @Column(name = "hmr_nombre")
    private String hmrNombre;
    @Basic(optional = false)
    @NotNull
    @Column(name = "hmr_estado")
    private int hmrEstado;
    @OneToMany(mappedBy = "hosMotivoReferencia", fetch = FetchType.LAZY)
    private List<HosMotRef> hosMotRefList;

    public HosMotivoReferencia() {
    }

    public HosMotivoReferencia(Integer hmrId) {
        this.hmrId = hmrId;
    }

    public HosMotivoReferencia(Integer hmrId, String hmrNombre, int hmrEstado) {
        this.hmrId = hmrId;
        this.hmrNombre = hmrNombre;
        this.hmrEstado = hmrEstado;
    }

    public Integer getHmrId() {
        return hmrId;
    }

    public void setHmrId(Integer hmrId) {
        this.hmrId = hmrId;
    }

    public String getHmrNombre() {
        return hmrNombre;
    }

    public void setHmrNombre(String hmrNombre) {
        this.hmrNombre = hmrNombre;
    }

    public int getHmrEstado() {
        return hmrEstado;
    }

    public void setHmrEstado(int hmrEstado) {
        this.hmrEstado = hmrEstado;
    }

    public List<HosMotRef> getHosMotRefList() {
        return hosMotRefList;
    }

    public void setHosMotRefList(List<HosMotRef> hosMotRefList) {
        this.hosMotRefList = hosMotRefList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (hmrId != null ? hmrId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof HosMotivoReferencia)) {
            return false;
        }
        HosMotivoReferencia other = (HosMotivoReferencia) object;
        if ((this.hmrId == null && other.hmrId != null) || (this.hmrId != null && !this.hmrId.equals(other.hmrId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "org.apli.haiam.ejb.entidades.HosMotivoReferencia[ hmrId=" + hmrId + " ]";
    }
    
}
